#pragma once

#include "IManager.h"
#include "CFrame.h"
#include "CAnimation.h"
#include <vector>
#include <windows.h>
using namespace std;

class CAnimation;

static int NumberofAnimes;

class CAnimationManager
{
	vector<CAnimation> m_vAnimations;
	int m_nAnimationCount;

	CAnimationManager();
	CAnimationManager(const CAnimationManager&);
	CAnimationManager& operator=(const CAnimationManager&);
	~CAnimationManager();
	
	CAnimation* Animate;

	int NumAnim;
	char m_szAniName[256];
	int m_nTotalFrames;
	char m_szImageFile[256];
	char m_szTrigName[256];
	bool m_bIsLooping;
	int m_fFrameLength;
	RECT m_rRenderRect;
	RECT m_rAttackRect;
	RECT m_rCollisionRect;
	int m_nAnchorPointX;
	int m_nAnchorPointY;
	int m_nWeaponPointX;
	int m_nWeaponPointY;
	int m_nFrameCount;

	CFrame Frame;
	
public:

	

	static CAnimationManager* GetInstance();

	void Init();
	void Clear();
	void Shutdown();
	void Load(const char* szFilePath);
	void Update(float fDelta, Animations* Anim);
	void Render(int nPosX, int nPosY, float fScale, DWORD dwColor, Animations Anim, bool bIsFlipped);
	void AddAnimation(CAnimation pAnimation);
};